#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    int n, i;
    long long cn[111] = {0};
    long long jp[111] = {0};
    long long a, b;
    long long scorecn, scorejp;
    while(true)
    {
        cin >> n;
        scorecn = 0;
        scorejp = 0;
        if(n==0)
        {
            break;
        }
        for (i = 0; i < n;i++)
        {
            cin >> cn[i];
        }
        for (i = 0; i < n;i++)
        {
            cin >> jp[i];
        }
        sort(cn, cn + n);
        sort(jp, jp + n);
        for (i = 0; i < n;i++)
        {
            if(cn[i] > jp[i])
            {
                scorecn += 2;
            }
            if(cn[i] == jp[i])
            {
                scorejp += 1;
                scorecn += 1;
            }
            if(jp[i] > cn[i])
            {
                scorejp += 2;
            }
        }
        cout << scorecn << " vs " << scorejp << endl;
    }
}